/*
  File: Time.h
  RCD A.2
*/

#ifndef TIME_H_	//include guard
#define TIME_H_	//include guard
#include<iostream>
using namespace std;

class Time {
 private:
  int h;	//hour, 0-23
  int m;	//minute, 0-59

 public:
  class Invalid{};	//exception class
  
  Time(int h, int m);	//constructor
  Time();	//constructor, h = 0, m = 0

  //non-modifying functions
  int hour() const {return h;}
  int minute() const {return m;}

  //modifying functions
  //  void add_hour(int n);	//add n hours to Time, doesn't support negative n ! Doesnt currently take Date into account when hour overflows
  //  void add_minute(int n);	//add n minutes to Time, doesn't support negative n ! same as above
};

bool is_time(int h, int m);	//true if time is valid

bool operator==(const Time& a, const Time& b);
bool operator!=(const Time& a, const Time& b);

std::ostream& operator<<(ostream& os, const Time& t);
std::istream& operator>>(istream& is, Time& tt);

#endif	//TIME_H_
